/* Copyright (c) Meta Platforms, Inc. and affiliates. */

@import '../index.css';

/* Usage hints for when no data is provided */
.no-data-helper {
  text-align: left;
  padding: 10px;
  border-radius: 10px;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: auto;
  background-color: var(--background-secondary);
}
.no-data-helper-text {
  color: var(--text-primary);
}

.header-text {
  color: var(--text-primary);
  padding-right: 15px;
  font-size: 12px;
}

/* For codec nodes - pill shaped (rounded rectangle) */
.codec-node {
  padding: 10px;
  border-radius: 25px;
  background-color: #d0e8f2; /* Default color */
  border: 2px solid #3498db;
  min-width: 300px;
  max-width: 600px;
  height: fit-content;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  color: #000;
  text-align: center;
  overflow: visible;
  z-index: 2;
  display: inline-block;
  word-break: break-word; /* Break long words instead of overflowing */
  transition: all 0.3s ease; /* Smooth transition for color changes */
}

/* Styling for collapsed nodes, just changing colors */
.codec-node.collapsed {
  background-color: #fff3e0; /* Color of a node with a collapsed subgraph */
  border: 3px solid #ff9800;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.codec-node.special-node {
  background-color: #dadee2ad;
  border: 3px solid #a5a5a5;
}

/* Styling for error errors, just changing colors */
.codec-node.error {
  background-color: #ffb7b7; /* Color of a node with a collapsed subgraph */
  border: 7px solid #ff0000;
  box-shadow: 0 4px 10px rgba(219, 52, 52, 0.3);
}

.node-header {
  font-weight: bold;
  margin-bottom: 8px;
  color: black;
  font-size: 20px;
  text-align: center;
}

.node-content {
  font-size: 20px;
  color: black;
  text-align: center;
}

.error-popover-content {
  color: black;
}

.node-content div {
  margin: 4px 0;
  white-space: nowrap; /* Prevent text wrapping */
  overflow: visible; /* Allow text to overflow if needed */
}

.react-flow__handle {
  width: 8px;
  height: 8px;
  background-color: #555;
  border: 1px solid #fff;
}

/* Custom styling for graph's control buttons */
.react-flow__controls-button {
  background-color: #f8f9fa;
  color: black;
  border: 1px solid #ccc;
}

.graph-node {
  pointer-events: none; /* Allow clicking through to nodes underneath */
  background-color: rgba(229, 169, 231, 0.25);
  border: 2px dashed rgba(207, 46, 212, 0.25);
  border-radius: 8px;
  padding: 10px;
  padding-bottom: 200px;
  z-index: -1;
  width: 100%;
  height: 100%;
  position: absolute;
  word-break: break-word;
}

.graph-node.error {
  pointer-events: visiblePainted; /* Default behavior to open pop-up */
  background-color: #ffb7b7; /* Color of a node with a collapsed subgraph */
  border: 7px solid #ff0000;
  box-shadow: 0 4px 10px rgba(219, 52, 52, 0.3);
}

.graph-node-header {
  font-size: 24px;
  font-weight: bold;
  color: black;
  text-align: center;
  width: 90%;
  padding: 4px;
}

.graph-node.collapsed {
  background-color: rgba(255, 0, 30, 0.25);
  border: 3px solid #ff9800;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
  padding-bottom: 0px;
  z-index: 2; /* Bring to the same level as codec nodes */
  width: 300px;
  height: fit-content;
}

/* Make the text within the graph node more prominent when collapsed */
.graph-node.collapsed .graph-node-header {
  font-size: 28px;
  margin-bottom: 10px;
  width: 90%;
}

.graph-collapse-or-expand-button {
  pointer-events: auto; /* Override the parent's pointer-events: none to make the buton clickable */
  position: absolute; /* absolute in the top right corner */
  cursor: pointer;
  --icon-size: 40px;
  --icon-hover-size: 50px;
  color: black;
  top: 10px;
  right: 10px;
}

.graph-collapse-or-expand-button svg {
  width: var(--icon-size);
  height: var(--icon-size);
  transition: all 0.2s ease;
}

.graph-collapse-or-expand-button:hover svg {
  color: rgb(95, 95, 95);
  transform: scale(1.2);
}

.collapse-or-expand-button {
  display: inline-block;
  --icon-size: 50px;
  --icon-hover-size: 60px;
  cursor: pointer;
}

.collapse-or-expand-button svg {
  width: var(--icon-size);
  height: var(--icon-size);
  transition: all 0.4s ease;
}

.collapse-or-expand-button:hover svg {
  width: var(--icon-hover-size);
  height: var(--icon-hover-size);
}

.expand-one-level-button {
  display: inline-block;
  --icon-size: 50px;
  --icon-hover-size: 60px;
  cursor: pointer;
}

.expand-one-level-button svg {
  width: var(--icon-size);
  height: var(--icon-size);
  transition: all 0.4s ease;
}

.expand-one-level-button:hover svg {
  width: var(--icon-hover-size);
  height: var(--icon-hover-size);
  transform: rotate(360deg);
}

.local-params-toggle {
  position: absolute;
  top: 5px;
  left: 5px;
  color: black;
  --icon-size: 50px;
  --icon-hover-size: 60px;
  cursor: pointer;
}

.local-params-toggle svg {
  width: var(--icon-size);
  height: var(--icon-size);
  transition: all 0.4s ease;
}

.local-params-toggle:hover svg {
  width: var(--icon-hover-size);
  height: var(--icon-hover-size);
}

.local-params-container {
  margin-top: 8px;
  padding: 8px;
  background-color: rgba(240, 240, 240, 0.95);
  border-radius: 4px;
  font-size: 12px;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: visible;
  text-align: left;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
  position: relative;
  resize: vertical;
  min-height: 50px;
}

.local-param-header {
  color: black;
  font-weight: bold;
  font-size: 24px;
}

.local-param-item {
  font-size: 22px;
  border-bottom: 1px dotted #a4a0a0;
  color: black;
}

/* Show local params under a graph node to not have it covered by nodes*/
.graph-local-params-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  pointer-events: auto;
  max-height: 150px;
  overflow-y: auto;
  z-index: 5;
}

.local-params-popover-container {
  position: absolute;
  top: 1px;
  left: 1px;
  pointer-events: auto;
  z-index: 10;
}

.popover-content {
  border-radius: 4px;
  padding: 10px;
  z-index: 5;
  min-width: 400px;
  max-width: 600px;
}
